package com.fit.entities.manytomany;

import java.io.Serializable;

import javax.persistence.Embeddable;
import javax.persistence.ManyToOne;

import com.fit.entities.Project;
import com.fit.entities.ScientificField;

@Embeddable
public class ProjSciFieldPk implements Serializable{

	@ManyToOne
	private Project project;
	@ManyToOne
	private ScientificField scientificField;
	
	public Project getProject() {
		return project;
	}
	public void setProject(Project project) {
		this.project = project;
	}
	public ScientificField getScientificField() {
		return scientificField;
	}
	public void setScientificField(ScientificField scientificField) {
		this.scientificField = scientificField;
	}
	
	public boolean equals(Object o) {
		if (this == o)
			return true;
		if (o == null || getClass() != o.getClass())
			return false;

		ProjSciFieldPk that = (ProjSciFieldPk) o;

		if (project != null ? !project.equals(that.project) : that.project != null)
			return false;
		if (scientificField != null ? !scientificField.equals(that.scientificField)
				: that.scientificField != null)
			return false;

		return true;
	}
}
